Skip to content

Consolidate 4 skills into 1 with progressive disclosure#81

Open
gdilla wants to merge 1 commit intoDeusData:mainfrom
gdilla:gautam/consolidate-skills-progressive-disclosure
Open

Consolidate 4 skills into 1 with progressive disclosure#81
gdilla wants to merge 1 commit intoDeusData:mainfrom
gdilla:gautam/consolidate-skills-progressive-disclosure

Conversation

@gdilla
Copy link

@gdilla gdilla commented Mar 20, 2026

Summary

Why

Problem: 4 description entries at startup

Every installed skill registers a name + description entry that the agent scans at session startup to decide which skills are relevant. With 4 separate skills, that's 4 entries consuming listing space — when a single skill with a comprehensive description covers all the same trigger phrases.

Problem: no progressive disclosure

The official spec recommends SKILL.md under 500 lines / ~5000 tokens, with detailed reference material in separate files loaded on demand. The current 4 skills are each standalone SKILL.md files with no references/ directory, meaning all content loads at activation regardless of what the user actually asked about.

Problem: scattered gotchas

The most valuable content — the pitfalls that prevent users from hitting common mistakes — was scattered across 4 files with no single source of truth. Per Anthropic's guidance: "The highest-value content in many skills is a list of gotchas."

What changed

assets/skills/ (the skill files)

Before After
codebase-memory-exploring/SKILL.md (90 lines) codebase-memory/references/exploring.md (61 lines)
codebase-memory-tracing/SKILL.md (125 lines) codebase-memory/references/tracing.md (99 lines)
codebase-memory-quality/SKILL.md (101 lines) codebase-memory/references/quality.md (85 lines)
codebase-memory-reference/SKILL.md (154 lines) codebase-memory/references/tool-reference.md (118 lines)
(no unified entry point) codebase-memory/SKILL.md (54 lines) — decision matrix + gotchas

The new SKILL.md is 54 lines and contains:

  1. A quick decision matrix — "what do you want to do?" → which tool call
  2. A routing table — points to the right reference file based on the task
  3. A consolidated gotchas section — the 7 most common mistakes in one place

Reference files are loaded only when the agent needs them for the specific task.

src/cli/cli.c (embedded skill content)

The 4 embedded C string constants are replaced by 1 self-contained skill that includes the decision matrix, all workflows, tool listing, edge types, Cypher examples, and gotchas. This embedded version is a fallback for the CLI installer — the full skill with references/ directory is in assets/skills/.

src/cli/cli.h

CBM_SKILL_COUNT changed from 4 to 1.

tests/test_cli.c

Updated to test the single consolidated skill. Verifies that all capabilities from all 4 former skills are present (search_graph, trace_call_path, detect_changes, max_degree, exclude_entry_points, query_graph, Cypher, 14 MCP Tools) plus the new gotchas section.

Migration

Users who have the old skills installed in ~/.claude/skills/ should:

  1. Delete the 4 old directories: codebase-memory-exploring, codebase-memory-tracing, codebase-memory-quality, codebase-memory-reference
  2. The new single codebase-memory skill will be installed automatically on next run

No functionality is lost — all content is preserved in the reference files.

Test plan

  • CBM_SKILL_COUNT compiles correctly as 1
  • test_cli.c passes — consolidated skill contains all capabilities
  • Skill installs as single codebase-memory/ directory with references/ subdirectory
  • Agent correctly routes to reference files based on user task
  • All trigger phrases from the 4 old descriptions work with the new consolidated description

🤖 Generated with Claude Code

@DeusData DeusData added the enhancement New feature or request label Mar 21, 2026
@DeusData
Copy link
Owner

Thanks @gdilla — this is a well-thought-out improvement. The consolidated skill with the decision matrix format and gotchas section is genuinely better for agents than 4 separate skills. The net token reduction at startup is a nice bonus.

Security review passed cleanly — no dangerous calls, no prompt injection concerns, content is purely instructional.

One issue before we can merge: the PR is based on an older version of main. Since then we've made significant changes to cli.c (search_code v2, shell-free exec, hook gate script) and deleted the cmd/ directory entirely (skill assets are now embedded as C string literals in cli.c only). This means:

  • The cmd/codebase-memory-mcp/assets/skills/ changes in this PR won't apply (directory no longer exists)
  • The cli.c changes will likely conflict with our recent modifications

Could you rebase against current main? The key change needed is updating the embedded skill content in src/cli/cli.c (the skill_content string literal and CBM_SKILL_COUNT constant). The cmd/ directory changes can be dropped.

Happy to help if you run into any issues with the rebase.

@DeusData DeusData added the ux/behavior Display bugs, docs, adoption UX label Mar 24, 2026
@sherif-fanous
Copy link

sherif-fanous commented Mar 26, 2026

I'm quite interested in this PR.

Adding the skill files directly to the repo allows users to use the skills.sh tool to install the skill and keep it updated.

@gdilla if you don't have the bandwidth to rebase against current main and resolve conflicts I'm willing to submit a new PR that takes care of this while ensuring you still get the due credit.

@gdilla
Copy link
Author

gdilla commented Mar 26, 2026

Whoops, didn't see the comments. yes, i'll work on it now.

Merge codebase-memory-exploring, codebase-memory-tracing,
codebase-memory-quality, and codebase-memory-reference into a single
codebase-memory skill.

Motivation:
- 4 skills = 4 description entries at session startup when 1 suffices
- Overlapping content (gotchas, tips) scattered with no single source
- Per Anthropic's Agent Skills best practices, skills should use
  progressive disclosure with concise SKILL.md + reference files

What changed:
- cli.c: 4 embedded skill strings consolidated into 1 with decision
  matrix, all workflows, and gotchas
- cli.h: CBM_SKILL_COUNT 4 → 1
- test_cli.c: updated to test single consolidated skill covering all
  capabilities from all 4 former skills

Rebased onto current main — dropped cmd/assets/skills/ changes since
that directory was removed upstream (skills are now embedded in cli.c
only).
@gdilla gdilla force-pushed the gautam/consolidate-skills-progressive-disclosure branch from cdc0c5c to 8f6258e Compare March 26, 2026 22:37
@sherif-fanous
Copy link

@gdilla Am I wrong or is the latest commit missing the actual assets/skill.md files?

@DeusData
Copy link
Owner

its embedded in the cli.c

@sherif-fanous
Copy link

The PR description mentions assets/skills/ and the first version had the skill embedded in cli.c as well as the mentioned files.

Looking at the updated cli.c it doesn't look like this PR implements the full PR. It currently has the main skill file but it seems to be missing the references/* files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ux/behavior Display bugs, docs, adoption UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants